<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">{-|
Module      :  Text.Parsec
Copyright   :  (c) Daan Leijen 1999-2001, (c) Paolo Martini 2007
License     :  BSD-style (see the LICENSE file)

Maintainer  :  aslatter@gmail.com
Stability   :  provisional
Portability :  portable

This module includes everything you need to get started writing a
parser.

By default this module is set up to parse character data. If you'd like
to parse the result of your own tokenizer you should start with the following
imports:

@
 import Text.Parsec.Prim
 import Text.Parsec.Combinator
@

Then you can implement your own version of 'satisfy' on top of the 'tokenPrim'
primitive.

-}</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Text.Parsec</span><span>
</span><span id="line-30"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="hs-comment">-- * Parsers</span></span><span>
</span><span id="line-31"></span><span>      </span><span class="annot"><a href="Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier">ParsecT</span></a></span><span>
</span><span id="line-32"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Parsec"><span class="hs-identifier">Parsec</span></a></span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#token"><span class="hs-identifier">token</span></a></span><span>
</span><span id="line-34"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#tokens"><span class="hs-identifier">tokens</span></a></span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runParserT"><span class="hs-identifier">runParserT</span></a></span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runParser"><span class="hs-identifier">runParser</span></a></span><span>
</span><span id="line-37"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parse"><span class="hs-identifier">parse</span></a></span><span>
</span><span id="line-38"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parseTest"><span class="hs-identifier">parseTest</span></a></span><span>
</span><span id="line-39"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#getPosition"><span class="hs-identifier">getPosition</span></a></span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#getInput"><span class="hs-identifier">getInput</span></a></span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#getState"><span class="hs-identifier">getState</span></a></span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#putState"><span class="hs-identifier">putState</span></a></span><span>
</span><span id="line-43"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#modifyState"><span class="hs-identifier">modifyState</span></a></span><span>
</span><span id="line-44"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Combinators</span></span><span>
</span><span id="line-45"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#%3C%7C%3E"><span class="hs-operator">(&lt;|&gt;)</span></a></span><span>
</span><span id="line-46"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator">(&lt;?&gt;)</span></a></span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#label"><span class="hs-keyword">label</span></a></span><span>
</span><span id="line-48"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#labels"><span class="hs-identifier">labels</span></a></span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#try"><span class="hs-identifier">try</span></a></span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#unexpected"><span class="hs-identifier">unexpected</span></a></span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#choice"><span class="hs-identifier">choice</span></a></span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#many"><span class="hs-identifier">many</span></a></span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#many1"><span class="hs-identifier">many1</span></a></span><span>
</span><span id="line-54"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#skipMany"><span class="hs-identifier">skipMany</span></a></span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#skipMany1"><span class="hs-identifier">skipMany1</span></a></span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#count"><span class="hs-identifier">count</span></a></span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#between"><span class="hs-identifier">between</span></a></span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#option"><span class="hs-identifier">option</span></a></span><span>
</span><span id="line-59"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#optionMaybe"><span class="hs-identifier">optionMaybe</span></a></span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#optional"><span class="hs-identifier">optional</span></a></span><span>
</span><span id="line-61"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#sepBy"><span class="hs-identifier">sepBy</span></a></span><span>
</span><span id="line-62"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#sepBy1"><span class="hs-identifier">sepBy1</span></a></span><span>
</span><span id="line-63"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#endBy"><span class="hs-identifier">endBy</span></a></span><span>
</span><span id="line-64"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#endBy1"><span class="hs-identifier">endBy1</span></a></span><span>
</span><span id="line-65"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#sepEndBy"><span class="hs-identifier">sepEndBy</span></a></span><span>
</span><span id="line-66"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#sepEndBy1"><span class="hs-identifier">sepEndBy1</span></a></span><span>
</span><span id="line-67"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#chainl"><span class="hs-identifier">chainl</span></a></span><span>
</span><span id="line-68"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#chainl1"><span class="hs-identifier">chainl1</span></a></span><span>
</span><span id="line-69"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#chainr"><span class="hs-identifier">chainr</span></a></span><span>
</span><span id="line-70"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#chainr1"><span class="hs-identifier">chainr1</span></a></span><span>
</span><span id="line-71"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#eof"><span class="hs-identifier">eof</span></a></span><span>
</span><span id="line-72"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#notFollowedBy"><span class="hs-identifier">notFollowedBy</span></a></span><span>
</span><span id="line-73"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#manyTill"><span class="hs-identifier">manyTill</span></a></span><span>
</span><span id="line-74"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#lookAhead"><span class="hs-identifier">lookAhead</span></a></span><span>
</span><span id="line-75"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#anyToken"><span class="hs-identifier">anyToken</span></a></span><span>
</span><span id="line-76"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Character Parsing</span></span><span>
</span><span id="line-77"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="Text.Parsec.Char.html"><span class="hs-identifier">Text.Parsec.Char</span></a></span><span>
</span><span id="line-78"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Error messages</span></span><span>
</span><span id="line-79"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#ParseError"><span class="hs-identifier">ParseError</span></a></span><span>
</span><span id="line-80"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html#errorPos"><span class="hs-identifier">errorPos</span></a></span><span>
</span><span id="line-81"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Position</span></span><span>
</span><span id="line-82"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier">SourcePos</span></a></span><span>
</span><span id="line-83"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#SourceName"><span class="hs-identifier">SourceName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Line"><span class="hs-identifier">Line</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#Column"><span class="hs-identifier">Column</span></a></span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#sourceName"><span class="hs-identifier">sourceName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#sourceLine"><span class="hs-identifier">sourceLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#sourceColumn"><span class="hs-identifier">sourceColumn</span></a></span><span>
</span><span id="line-85"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#incSourceLine"><span class="hs-identifier">incSourceLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#incSourceColumn"><span class="hs-identifier">incSourceColumn</span></a></span><span>
</span><span id="line-86"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#setSourceLine"><span class="hs-identifier">setSourceLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#setSourceColumn"><span class="hs-identifier">setSourceColumn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html#setSourceName"><span class="hs-identifier">setSourceName</span></a></span><span>
</span><span id="line-87"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Debugging</span></span><span>
</span><span id="line-88"></span><span>     </span><span class="hs-comment">--</span><span>
</span><span id="line-89"></span><span>     </span><span class="hs-comment">-- | As a more comprehensive alternative for debugging Parsec parsers,</span><span>
</span><span id="line-90"></span><span>     </span><span class="hs-comment">-- there's also the [parsec-free](http://hackage.haskell.org/package/parsec-free)</span><span>
</span><span id="line-91"></span><span>     </span><span class="hs-comment">-- package.</span><span>
</span><span id="line-92"></span><span>     </span><span class="hs-comment">--</span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#parserTrace"><span class="hs-identifier">parserTrace</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html#parserTraced"><span class="hs-identifier">parserTraced</span></a></span><span>
</span><span id="line-94"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Low-level operations</span></span><span>
</span><span id="line-95"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#manyAccum"><span class="hs-identifier">manyAccum</span></a></span><span>
</span><span id="line-96"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#tokenPrim"><span class="hs-identifier">tokenPrim</span></a></span><span>
</span><span id="line-97"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#tokenPrimEx"><span class="hs-identifier">tokenPrimEx</span></a></span><span>
</span><span id="line-98"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runPT"><span class="hs-identifier">runPT</span></a></span><span>
</span><span id="line-99"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#unknownError"><span class="hs-identifier">unknownError</span></a></span><span>
</span><span id="line-100"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#sysUnExpectError"><span class="hs-identifier">sysUnExpectError</span></a></span><span>
</span><span id="line-101"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#mergeErrorReply"><span class="hs-identifier">mergeErrorReply</span></a></span><span>
</span><span id="line-102"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#getParserState"><span class="hs-identifier">getParserState</span></a></span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#setParserState"><span class="hs-identifier">setParserState</span></a></span><span>
</span><span id="line-104"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#updateParserState"><span class="hs-identifier">updateParserState</span></a></span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Stream"><span class="hs-identifier">Stream</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-106"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runParsecT"><span class="hs-identifier">runParsecT</span></a></span><span>
</span><span id="line-107"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#mkPT"><span class="hs-identifier">mkPT</span></a></span><span>
</span><span id="line-108"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#runP"><span class="hs-identifier">runP</span></a></span><span>
</span><span id="line-109"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Consumed"><span class="hs-identifier">Consumed</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-110"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#Reply"><span class="hs-identifier">Reply</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#State"><span class="hs-identifier">State</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-112"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#setPosition"><span class="hs-identifier">setPosition</span></a></span><span>
</span><span id="line-113"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#setInput"><span class="hs-identifier">setInput</span></a></span><span>
</span><span id="line-114"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Other stuff</span></span><span>
</span><span id="line-115"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#setState"><span class="hs-identifier">setState</span></a></span><span>
</span><span id="line-116"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#updateState"><span class="hs-identifier">updateState</span></a></span><span>
</span><span id="line-117"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parsecMap"><span class="hs-identifier">parsecMap</span></a></span><span>
</span><span id="line-118"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserReturn"><span class="hs-identifier">parserReturn</span></a></span><span>
</span><span id="line-119"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserBind"><span class="hs-identifier">parserBind</span></a></span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserFail"><span class="hs-identifier">parserFail</span></a></span><span>
</span><span id="line-121"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserZero"><span class="hs-identifier">parserZero</span></a></span><span>
</span><span id="line-122"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html#parserPlus"><span class="hs-identifier">parserPlus</span></a></span><span>
</span><span id="line-123"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.Parsec.Pos.html"><span class="hs-identifier">Text.Parsec.Pos</span></a></span><span>
</span><span id="line-126"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.Parsec.Error.html"><span class="hs-identifier">Text.Parsec.Error</span></a></span><span>
</span><span id="line-127"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.Parsec.Prim.html"><span class="hs-identifier">Text.Parsec.Prim</span></a></span><span>
</span><span id="line-128"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.Parsec.Char.html"><span class="hs-identifier">Text.Parsec.Char</span></a></span><span>
</span><span id="line-129"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.Parsec.Combinator.html"><span class="hs-identifier">Text.Parsec.Combinator</span></a></span><span>
</span><span id="line-130"></span></pre></body></html>